package main

import (
	linq "github.com/ahmetalpbalkan/go-linq"
	"fmt"
)

func main() {
	type Car struct {
		id, year int
		owner, model string
	}
	cars := []Car{
		{1, 2015, 3, "jetta"},
		{2, 2015, 1, "polo"},
	}

	type User struct {
		id int
		name string
	}
	users := []User{
		{1, "aaa"},
		{2, "bbb"},
		{3, "ccc"},
	}

	owners := []string{}

	linq.From(cars).Where(func(c interface{}) bool {
		return c.(Car).year >= 2015
	}).Select(func(c interface{}) interface{} {
		return c.(Car).owner
	}).ToSlice(&owners)

	fmt.Printf("%+v", owners)
}
